<!DOCTYPE html>
<html lang="en">
<head>
    <!--
    @Author 硕鼠
    @Date 2020/4/7 11:46
    @Version 1.0
    @Description 父节点
  -->
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        window.onload = function () {
            var aLi = document.getElementsByTagName('a');
            for (var i = 0;i < aLi.length;i++){
                aLi[i].onclick = function () {
                    //将<a>标签的父节点li给隐藏（this指代<a>标签）
                    this.parentNode.style.display = 'none';
                };
            }
        };
    </script>
</head>
<body>

<ul id="ul1">
    <li>123 <a href="javascript:;">隐藏</a></li>
    <li>abc <a href="javascript:;">隐藏</a></li>
</ul>
</body>
</html>